package main

import (
	"fmt"
)

func sum(resultChan chan int, values []int) {
	sum := 0
	for _,v := range values {
		sum += v
	}
	resultChan<-sum
}

func main() {
	values := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

	var x string = "hello"
	x = "world"
	fmt.Println(x)

	resultChan := make(chan int)
	go sum(resultChan,values[:len(values)/2])
	go sum(resultChan,values[len(values)/2:])
	sum1,sum2 := <-resultChan,<-resultChan

	fmt.Printf("%d %d %d",sum1,sum2,sum1+sum2)
}
